import request from '@/utils/request'

export function login(data) {
  return request({
    url: '/user/login',
    method: 'post',
    data
  })
}

export function getUserList() {
  return request({
    url: '/user/userlist',
    method: 'get',
    contentType:'application/json',
    headers:{
      'Content-Type': 'application/json'
    },
    dataType:"json",
    async:false,
  })
}

export function updateUserInfo(data){
  return request({
    url:'/user/backupdateuserinfo',
    method:'post',
    contentType:'application/json',
    headers:{
      'Content-Type':'application/json'
    },
    dataType:'json',
    async:false,
    data
  })
}

export function changeUserState(data){
  return request({
    url:'/user/changeuserstate',
    method:'post',
    contentType:'application/json',
    headers:{
      'Content-Type':'application/json'
    },
    dataType:'json',
    async:false,
    data
  })
}

export function logout() {
  return request({
    url: '/user/logout',
    method: 'post'
  })
}
